package com.cryrabbit.yyystitp.net;

import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by CryRabbit on 2016/9/2.
 */

public class LoginHttpMethods extends BaseHttpMethods{
    private LoginService loginService;
    public LoginHttpMethods(){
        super();
        loginService=retrofit.create(LoginService.class);
    }
    public void getNet(Subscriber<String> stringSubscriber,String user, String pass){
        loginService.getResult(user,pass)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(stringSubscriber);
    }
    private interface LoginService{
        @POST("yyy/Login")
        Observable<String> getResult(@Query("uname") String user, @Query("upwd") String pass);
    }
}
